package com.winchain.chainbill.tbill.biz;

import com.shell.bee.acct.transaction.po.AcctTxRec;
import com.winchain.chainbill.tbill.base.po.TbRec;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class BatchTBillStats<T> {
	private int affectedRows;
	private Map<String, BigDecimal> assets;
	private List<TBill<T>> abnormalRecords;
	private List<String> abnormalMsgs;
	private String txSnHost;
	List<AcctTxRec> acctTxRecs;

	public int getAffectedRows() {
		return this.affectedRows;
	}

	public void setAffectedRows(int affectedRows) {
		this.affectedRows = affectedRows;
	}

	public int addAffectedRows() {
		return ++this.affectedRows;
	}

	public Map<String, BigDecimal> getAssets() {
		return this.assets;
	}

	public void setAssets(Map<String, BigDecimal> assets) {
		this.assets = assets;
	}

	public void addPassedRecord(TBill<T> record) {
		if (this.assets == null) {
			this.assets = new HashMap();
		}
		addAffectedRows();
		String key = record.getRec().getBillId();
		BigDecimal bm = record.getRec().getBillAmt();
		BigDecimal value = (BigDecimal) this.assets.get(key);
		if (value == null) {
			value = new BigDecimal(0);
		}
		value = value.add(bm);
		this.assets.put(key, value);
	}

	public void addAbnormalRecord(TBill<T> record) {
		if (this.abnormalRecords == null) {
			this.abnormalRecords = new ArrayList();
		}
		this.abnormalRecords.add(record);
	}

	public void addAbnormalMsg(String msg) {
		if (this.abnormalMsgs == null) {
			this.abnormalMsgs = new ArrayList();
		}
		this.abnormalMsgs.add(msg);
	}

	public List<TBill<T>> getAbnormalRecord() {
		return this.abnormalRecords;
	}

	public void setAbnormalRecord(List<TBill<T>> abnormalRecords) {
		this.abnormalRecords = abnormalRecords;
	}

	public List<String> getAbnormalMsg() {
		return this.abnormalMsgs;
	}

	public void setAbnormalMsg(List<String> abnormalMsgs) {
		this.abnormalMsgs = abnormalMsgs;
	}

	public String getTxSnHost() {
		return this.txSnHost;
	}

	public void setTxSnHost(String txSnHost) {
		this.txSnHost = txSnHost;
	}

	public List<AcctTxRec> getAcctTxRecs() {
		return this.acctTxRecs;
	}

	public void setAcctTxRecs(List<AcctTxRec> acctTxRecs) {
		this.acctTxRecs = acctTxRecs;
	}
}
